package hhm.javamode.strategy.pay.error;

/**
 * 对于一个新手的代码如下：
 * 
 * @author hhm
 *
 */
public class Example {
	public Double calRecharge(Double charge, RechargeTypeEnum type) {

		if (type.equals(RechargeTypeEnum.E_BANK)) {
			return charge * 0.85;
		} else if (type.equals(RechargeTypeEnum.BUSI_ACCOUNTS)) {
			return charge * 0.90;
		} else if (type.equals(RechargeTypeEnum.MOBILE)) {
			return charge;
		} else if (type.equals(RechargeTypeEnum.CARD_RECHARGE)) {
			return charge + charge * 0.01;
		} else {
			return null;
		}

	}
}
